package com.ruoyi.web.controller.system;

import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.web.service.SysPermissionService;
import org.apache.catalina.security.SecurityUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.util.PatternMatchUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collection;

/**
 * @author ：jijinwu
 * @ClassName SysPermissionsController
 * @date ：2024/7/18 - 22:50
 * @version: V1.0
 * @slogan: 天下风云出我辈，一入代码岁月催
 * @description:
 **/
@RestController
@RequestMapping("/system/permissions")
public class SysPermissionsController {

    @Autowired
    private SysPermissionService sysPermissionService;


    @PostMapping("/hasPermi")
    public AjaxResult hasPermi(String permission, String username){
        AjaxResult ajaxResult = new AjaxResult();
        ajaxResult.put("data",sysPermissionService.hasPermi(permission,username));
        return ajaxResult;
    }

}

